home *** CD-ROM | disk | FTP | other *** search
- Path: host1.einstein.com.ar!news
- From: jkohen@einstein.com.ar (Javier Kohen)
- Newsgroups: comp.lang.c++
- Subject: Re: HELP: Code in Header Files
- Date: Sat, 06 Apr 1996 02:16:36 GMT
- Organization: Red Einstein
- Message-ID: <4k4pku$pea@host1.einstein.com.ar>
- References: <4jakhm$g3d@news.asu.edu>
- Reply-To: jkohen@einstein.com.ar
- NNTP-Posting-Host: ppp-12.einstein.com.ar
- X-Newsreader: Forte Free Agent 1.0.82
-
- ryan1m@imap2.asu.edu wrote:
-
-
- >I have a problem understanding how header files work. If it matters I am
- >using Borland C++ 4.5...
-
- >The problem is I defined a header file string.h in this I declared a
- >string class. If I put the actual code to the functions in this class
- >into the header file, the compiler does not like it. I looked at other
- >.h files and saw they did not do it this way.
-
- >So then I tried writing the actual code into string.cpp and compiling
- >that with and #include "string.h".
-
- >It worked but my code for my program does not recognize the functions.
- >It says I did not code them yet.
-
- You must compile the file with main() and string.cpp together.
- ie: (what's exactly ie, sorry but i am a spanish speaker)
-
- bcc main.cpp string.cpp
-
- If you're using the IDE, use add node option and add the string.cpp
- file.
-
- >It finds the headers just fine but not the actual code.
-
- >ie:
-
- >#include "string.h"
-
- >void main(void)
-
- (void) = () in c++
-
- >{
- > String blah("hello world");
- >}
-
- >the error will say something like
-
- >Undefined Symbol String::~String() in module STEST.CPP
-
- >and it goes on to list the rest of the function not "defined".
-
- >Please help...
-
- >Thanks,
-
- I could explain you all about this, τause i had the same kind of
- problems, but looking another people programs, the compiler manuals
- and playing with it, i got the idea.
-
- >Mike Ryan ryan1m@asu.edu
-
- Javier Kohen jkohen@einstein.com.ar
-
-
-